/* 
"total": 28,
    "items": [
      {
        "id": "string",
        "gmtCreate": "2022-11-30 20:58:42",
        "gmtModified": "2022-11-30 20:58:42",
        "deleted": false,
        "username": "8585",
        "password": "ed556265816011ba76a53e5cf54450cf",
        "nickName": "888",
        "salt": "string",
        "token": "string",
        "roleName": "平台管理员"
      }, */

export interface GetUserListApiParams {
  page: number;
  limit: number;
  username: string;
}

export interface UserItem {
  id: string;
  gmtCreate: string;
  gmtModified: string;
  username: string;
  nickName: string; // 用户名称
  roleName: string; // 角色列表
}
export type UserList = UserItem[];

export interface GetUserListApiResponse {
  total: number;
  items: UserList;
}

// 增加
export interface AddUserApiParams
  extends Pick<UserItem, "username" | "nickName"> {
  password: string;
}
export interface AddOrUpdateUserFormData extends AddUserApiParams {
  id?: string;
}

// 修改
export interface UpdateApiParams extends AddUserApiParams {
  id: string;
}

export interface RolesItem {
  id: string;
  gmtCreate: string;
  gmtModified: string;
  roleName: string;
}
export type RolesList = RolesItem[];

export interface GetUserRoleListApiResponse {
  assignRoles: RolesList;
  allRolesList: RolesList;
}
